#ifndef HELLOWINDOW_H
#define HELLOWINDOW_H

#include <QWindow>
#include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>

class HelloWindow : public QWindow, protected QOpenGLFunctions_3_3_Core
{
public:
    HelloWindow();
    ~HelloWindow() override;

    bool event(QEvent *event) override;

public slots:
    void renderNow();
    void renderLater();

protected:
    void exposeEvent(QExposeEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;

private:
    QOpenGLContext *m_context;
    QOpenGLShaderProgram *m_program;
    bool m_update_pending;

    QOpenGLVertexArrayObject *m_vao;
    QOpenGLBuffer *m_vbo;
};

#endif // HELLOWINDOW_H
